<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShowingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('showings', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('property_id')->comment('房源id');
            $table->string('title')->comment('名称');
            $table->unsignedInteger('agent_id')->default(0)->comment('经纪人id');
            $table->string('name')->comment('姓名');
            $table->string('tel')->comment('电话');
            $table->string('show_date')->comment('看房日期');
            $table->string('show_time')->nullable()->comment('看房时间');
            $table->string('message')->nullable()->comment('其他说明');
            $table->string('status')->default('F')->comment('状态：T 已处理 F 待处理 D 处理中');
            $table->string('type')->default('new')->comment('类型：new 新房 hand 二手房 rental 租房');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('showings');
    }
}
